
<?php
include("../connect/connect.php");
include('../function/function.php');
	/*** By Weerachai Nukitram ***/
	/***  http://www.ThaiCreate.Com ***/
/*
include("../connect/connect.php");
include('../function/function.php');

$tABF = $_POST['abf'];
$ExtraAbf = $_POST['ExtraAbf'];
$Extra = $_POST['Extra'];
$AbfA = $_POST['AbfA'];
$AbfC = $_POST['AbfC'];
$AddA = $_POST['AddA'];
$AddC = $_POST['AddC'];
$gValue = $_POST['gValue'];


 * รหัสข้อมูล
$tABF = 1
$ExtraAbf = 2
$Extra = 3
$AbfA = 4
$AbfC = 5
$AddA = 6
$AddC = 7


echo "tABF=".$tABF."<br>";
echo "ExtraAbf=".$ExtraAbf."<br>";
echo "Extra=".$Extra."<br>";
echo "AbfA=".$AbfA."<br>";
echo "AbfC=".$AbfC."<br>";
echo "AddA=".$AddA."<br>";
echo "AddC=".$AddC."<br>";
*/
//$rQuery = mysql_query("SELECT roomtype.roomtype_name as roomtype_name,count(roomtype.roomtype_id) as roomtype_id,group_detail_room.group_detail_room_price as group_detail_room_price FROM roomselect_session,roomtype,room,group_detail,group_detail_room WHERE group_detail_room.group_detail_id = group_detail.group_detail_id AND group_detail_room.roomtype_id = roomtype.roomtype_id AND room.roomtype_id=group_detail_room.roomtype_id AND room.room_id=roomselect_session.room_id AND group_detail.group_detail_id = '".$gValue."' GROUP BY roomtype.roomtype_id ORDER BY roomtype.roomtype_name");

//$sQuery = mysql_query("SELECT group_detail_name FROM group_detail WHERE group_detail_id = '".$gValue."'");
//$sRow = mysql_fetch_array($sQuery);

$rID = $_POST['rID'];
?>
<!-- แสดงรายการ กรุ๊ป -->
<h3>กรุ๊ป</h3>
<table  id="myTbl" class="list">
<thead>
  <tr>
  	<td class="center" width="1">ลำดับ</td>
    <td class="center" width="1">รายการ</td>
    <td class="center" width="1">จำนวน</td>
    <td class="center" width="1">ราคา/หน่วย</td>
    <td class="center">รวม</td>
  </tr>
</thead>
<?php 
$rQuery = mysql_query("SELECT * FROM reservation_group WHERE reservation_detail_id='$rID'");
$Num=0;
while($rRow = mysql_fetch_array($rQuery)){
	$Num++;
?>
  <tr>
    <td class="center"><?php echo $Num;?></td>
    <td class="center"><input type="text" name="list[]" id="list<?php echo $Num;?>" value="<?php echo $rRow['reservation_group_list'];?>" size="50" /></td>
    <td class="center"><input type="text" name="amount[]" id="amount<?php echo $Num;?>" value="<?php echo $rRow['reservation_group_amount'];?>" onfocus="SumGroup('<?php echo $Num;?>');" onkeyup="SumGroup('<?php echo $Num;?>');IsNumeric(this.value,this);" id="amount1" size="2" style="text-align: right;" /></td>
    <td class="center"><input type="text" name="price[]" id="price<?php echo $Num;?>" value="<?php echo $rRow['reservation_group_price'];?>" onfocus="SumGroup('<?php echo $Num;?>');" onkeyup="SumGroup('<?php echo $Num;?>');IsNumeric(this.value,this);" size="5" style="text-align: right;" /></td>
    <td class="pRight"><input type="hidden" name="total2[]" id="total2<?php echo $Num;?>" value="<?php echo $rRow['reservation_group_amount']*$rRow['reservation_group_price'];?>" /><span id="total<?php echo $Num;?>"><?php echo bath_format($rRow['reservation_group_amount']*$rRow['reservation_group_price']);?></span></td>
  </tr>
<?php
	$total = $total+($rRow['reservation_group_amount']*$rRow['reservation_group_price']);
}
for($i=$Num+1;$i<=20;$i++){
?>
  <tr>
    <td class="center"><?php echo $i;?></td>
    <td class="center"><input type="text" name="list[]" id="list<?php echo $i;?>" size="50" /></td>
    <td class="center"><input type="text" name="amount[]" id="amount<?php echo $i;?>" onfocus="SumGroup('<?php echo $i;?>');" onkeyup="SumGroup('<?php echo $i;?>');IsNumeric(this.value,this);" id="amount1" size="2" style="text-align: right;" /></td>
    <td class="center"><input type="text" name="price[]" id="price<?php echo $i;?>" onfocus="SumGroup('<?php echo $i;?>');" onkeyup="SumGroup('<?php echo $i;?>');IsNumeric(this.value,this);" size="5" style="text-align: right;" /></td>
    <td class="pRight"><input type="hidden" name="total2[]" id="total2<?php echo $i;?>" value="0" /><span id="total<?php echo $i;?>"></span></td>
  </tr>
<?php } ?>
  <tr>
    <td class="center" colspan="4" ><b>รวมเป็นเงิน</b></td>
    <td class="pRight"><span id="totala2" style="font-weight: bold;"><?php echo bath_format($total);?></span></td>
  </tr>
</table>
<font color="red">**หมายเหตุ : ไม่ต้องกรอกข้อมูลให้ครบทุกช่องก็ได้ให้เว้นว่างไว้ได้เลยค่ะ</font>